package com.example.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jie
 * @date 2020/8/26 -9:18
 */
@Api(description = "测试")
@RestController("/test")
public class TestController {


    @ApiOperation("多参数")
    @GetMapping("/aabb")
    public Object aabb(String aa, String bb) {

        //测试通过
        System.out.println(aa);
        System.out.println(bb);
        return aa + "--" + bb;
    }

    @ApiOperation("斜杠传值")
    @GetMapping("/test/{id}")
    public Object cc(@PathVariable String id) {
        //测试通过
        System.out.println(id);
        return id;
    }

    @ApiOperation("一个参数")
    @GetMapping("/only_one_arg")
    public Object OnlyOneArg(String id) {

        //测试通过
        return id;
    }

    @ApiOperation("无参")
    @GetMapping("/no_arg")
    public Object noArg() {

        //测试通过
        return null;
    }


}


